using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using Reimers.Map;

public partial class examples_csharp_overlays : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        GMap.GoogleKey = ConfigurationManager.AppSettings["MapKey"];
        //Don't recreate markers on every postback, they are stored in viewstate.
        if (!Page.IsPostBack)
        {
            GMap.Center = new Reimers.Map.GoogleLatLng(54, 0);
            GoogleMarker gm1 = new GoogleMarker("mrkClick", 54, 0);
            gm1.ClientSideHandlers.OnClick = gm1.OpenInfoWindowHTML(GMap, "This marker is clickable, the other is not.");
            GMap.Overlays.Add(gm1);
            GoogleMarker gm2 = new GoogleMarker("mrkNoClick", 0, 0, new GoogleMarkerOptions(false));
            GMap.Overlays.Add(gm2);
            //Create a circle 300 km around marker 2.
            //If you change the circle center to marker 1's coordinates you can see the effects of projection.
            GooglePolyline pl = new GooglePolyline("circle", GooglePolyline.DrawCircle(new GoogleLatLng(0, 0), 3000, Units.Metric, 15), System.Drawing.Color.ForestGreen, 8);
            GMap.Overlays.Add(pl);
        }
    }
}
